<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <!-- 移动端正常展示 -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
<div id="app">
  <!-- isShos 使用的是外部实例的变量 -->
  <cpn v-show="isShow"></cpn>
</div>

<template id="cpn">
  <div>
    <h2>我是子组件</h2>
    <p>内容</p>
    <!-- 子级变量 -->
    <button v-show="isShow">我是被子组件isShow控制显示的按钮</button>
  </div>
</template>

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el : '#app',
    data : {
      message : "I don't wanna see u anymore",
      isShow : true
    },
    components : {
      cpn : {
        template : '#cpn',
        data() {
          return {
            isShow : false
          }
        }
      }
    }
  });
</script>

</body>
</html>